home *** CD-ROM | disk | FTP | other *** search
/ Hyper Stacks 1994 May / Hyper Stacks (Pacific HiTech)(1994)[Mac].iso / Education / Webs / card_2908.txt < prev    next >
Encoding:
Text File  |  1988-11-10  |  3.5 KB  |  166 lines

  1. -- card: 2908 from stack: in
  2. -- bmap block id: 2509
  3. -- flags: 0000
  4. -- background id: 2685
  5. -- name: 
  6.  
  7.  
  8. -- part 1 (button)
  9. -- low flags: 00
  10. -- high flags: 2000
  11. -- rect: left=447 top=159 right=183 bottom=502
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Simulate Problem
  20. ----- HyperTalk script -----
  21. on mouseUp
  22.  
  23.   -- These lines set up the drawing params the way I want them
  24.   set the dragspeed to 0
  25.   global userlevel
  26.   put the linesize into linetemp
  27.   set the linesize to 1
  28.   put the userlevel into usertemp
  29.   set userlevel to 3
  30.   put the brush into brushtemp
  31.   set the brush to 32
  32.   put the pattern into patterntemp
  33.   set the pattern to 12
  34.   global arm
  35.   global cent
  36.   put 143 into arm
  37.   put "256,179" into cent
  38.   put empty into field "Dots"
  39.   ask "How many points are there?"
  40.   put round (it) into pts
  41.   put pts into card field "Sources"
  42.   put 2*pi/pts into theta
  43.   choose select tool
  44.   drag from 84,21 to 444,335
  45.   doMenu "Clear Picture"
  46.   put 0 into  card field "Tally"
  47.   choose brush tool
  48.  
  49.   -- This draws the dots on the circle
  50.   repeat with x = 0 to ( pts - 1)
  51.     put round ( arm * ( cos ( theta * x ) ) ) into hor
  52.     put round ( arm * ( sin ( theta * x ) ) ) into ver
  53.     put cent into spot
  54.     add hor to item 2 of spot
  55.     add ver to item 1 of spot
  56.     put spot & return after field "Dots"
  57.     click at spot
  58.   end repeat
  59.  
  60.   -- This draws the connecting lines
  61.   choose line tool
  62.   repeat with a = 1 to ( pts - 1 )
  63.     repeat with b = a to ( pts - 1 )
  64.       drag from line a of field "Dots" to line ( b + 1 ) of field "Dots"
  65.       add 1 to card field "Tally"
  66.     end repeat
  67.   end repeat
  68.  
  69.   -- These commands set the painting parameters
  70.   -- back to what they were before I changed them
  71.   choose browse tool
  72.   set the userlevel to usertemp
  73.   set the brush to brushtemp
  74.   set the linesize to linetemp
  75.   set the pattern to patterntemp
  76.  
  77. end mouseUp
  78.  
  79.  
  80.  
  81. -- part 2 (field)
  82. -- low flags: 01
  83. -- high flags: 2002
  84. -- rect: left=445 top=215 right=238 bottom=503
  85. -- title width / last selected line: 0
  86. -- icon id / first selected line: 0 / 0
  87. -- text alignment: 1
  88. -- font id: 2
  89. -- text size: 14
  90. -- style flags: 0
  91. -- line height: 18
  92. -- part name: Tally
  93.  
  94.  
  95. -- part 3 (button)
  96. -- low flags: 00
  97. -- high flags: 0002
  98. -- rect: left=451 top=30 right=64 bottom=497
  99. -- title width / last selected line: 0
  100. -- icon id / first selected line: 1011 / 1011
  101. -- text alignment: 1
  102. -- font id: 0
  103. -- text size: 12
  104. -- style flags: 0
  105. -- line height: 16
  106. -- part name: Home
  107. ----- HyperTalk script -----
  108. on mouseUp
  109.   visual effect venetian blinds
  110.   go home
  111. end mouseUp
  112.  
  113.  
  114.  
  115. -- part 4 (button)
  116. -- low flags: 00
  117. -- high flags: 0002
  118. -- rect: left=451 top=69 right=106 bottom=496
  119. -- title width / last selected line: 0
  120. -- icon id / first selected line: 1020 / 1020
  121. -- text alignment: 1
  122. -- font id: 0
  123. -- text size: 12
  124. -- style flags: 0
  125. -- line height: 16
  126. -- part name: Home
  127. ----- HyperTalk script -----
  128. on mouseUp
  129.   visual effect scroll left
  130.   go next card
  131. end mouseUp
  132.  
  133.  
  134.  
  135. -- part 5 (field)
  136. -- low flags: 01
  137. -- high flags: 2002
  138. -- rect: left=445 top=287 right=310 bottom=503
  139. -- title width / last selected line: 0
  140. -- icon id / first selected line: 0 / 0
  141. -- text alignment: 1
  142. -- font id: 2
  143. -- text size: 14
  144. -- style flags: 0
  145. -- line height: 18
  146. -- part name: Sources
  147.  
  148.  
  149. -- part contents for card part 2
  150. ----- text -----
  151. 21
  152.  
  153. -- part contents for card part 5
  154. ----- text -----
  155. 7
  156.  
  157. -- part contents for background part 1
  158. ----- text -----
  159. 256,322
  160. 368,268
  161. 395,147
  162. 318,50
  163. 194,50
  164. 117,147
  165. 144,268
  166.